/**
 * Created with JetBrains WebStorm.
 * User: Administrator
 * Date: 14-6-17
 * Time: 下午1:39
 * To change this template use File | Settings | File Templates.
 */
define(function(require,exports,module){
    var VERSION = '1.0',
        jQuery = $ = require("jquery-1.8.2.min");
    var dropId,dropDown,timeout;
    var defaults = {

    };
    function dropDown(element,options){
        this.$elem = $(element);
        this.options = $.extend({},defaults,options);

        this.init()
    }
    dropDown.prototype = {
        init:function(){
            var that = this;
            this.$elem.hover(function(){
                clearTimeout(timeout);
                 dropId = $(this).data("dropdown");
                 dropDown = $("#" + dropId);
                var offset = $(this).offset();
                dropDown.css({
                    "top":offset.top + $(this).outerHeight() - 2,
                    "left":offset.left,
                    "width":$(this).outerWidth()
                });
                that.delay(dropDown);
               // $(this).addClass("wd_dropDown_active");
                $(this).find("i").removeClass("icon-arrow-up-4").addClass("icon-arrow-up-5")
            },function(){
                clearTimeout(timeout);
                dropDown.hide();
               // $(this).removeClass("wd_dropDown_active");
                $(this).find("i").removeClass("icon-arrow-up-5").addClass("icon-arrow-up-4")
            })
        },
        delay:function(dom){
            timeout = setTimeout(function(){
                dom.show()
            },200)
        }
    };
    return dropDown;
});